Repository navigation
Conversation
…property Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello maintainers, I'd like to help with issue #142 by offering a change for you to review that handles multiple annotations on the same target without reporting an invalid schema.
Metadata that carries more than one unqualified
ValueListannotation for the same property made the parser raiseCannot replace value helper ..., so the schema was reported invalid (and a strict error policy aborted). A property can only hold one value helper here, so the first one is now kept and each later one is logged as ignored; the schema stays valid.Fixes #142. Thanks for attaching the metadata file and
reproduce.py; with your files theis_validresult went from False to True on this change.Tests: new
test_annot_v_l_duplicate_targetintests/test_model_v2.py(two ValueList annotations on one property: schema valid, first one kept, warning logged). It fails with the originalRuntimeErrorwhen the change inmodel.pyis reverted. The fulltestsdirectory ran with pytest on Python 3.14: 319 passed. I did not run pylint (it crashes in my environment on this Python version) or the older Python versions from the CI matrix.I took the "keep one and warn" route rather than ignoring all annotations (option B in the issue), because value helpers are used by the model today. Happy to change it if you prefer the other.